package com.example.demo.mapper;

import com.example.demo.mapper.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface SelectorMapper {
    @Select("SELECT * FROM item")
    List<Item> getItemList();
    @Select("SELECT attribute_id,name FROM attribute")
    List<Attribute> getAttributeList();
    @Select("SELECT * FROM `clothing` ORDER BY `type` ASC")
    List<Clothing> getClothingSort();
    @Select("SELECT * FROM `coupons` ORDER BY `coupons_type` ASC")
    List<Coupons> getCouponsSort();
    @Select("SELECT * FROM `badge` ORDER BY `type` ASC")
    List<Badge> getBadgeSort();
    @Select("SELECT * FROM college")
    List<College> getCollegeList();
    @Select("SELECT * FROM major WHERE college_id = #{collegeId} ORDER BY major_id")
    List<Major> findMajorByFather(int collegeId);
    @Select("SELECT * FROM clazz WHERE major_id = #{majorId} ORDER BY clazz_id")
    List<Clazz> findClazzByFather(int majorId);
}
